import request from '@/api/request'
import { AxiosPromise } from 'axios'

enum API {
    BASE_URL = "/system/tenants"
}

export const searchTenantApi = (query:any): AxiosPromise<any> => {
    return request.get<any>(API.BASE_URL + "/search", {
        params: query
    })
}

export const createTenantApi = (data: any): AxiosPromise<any> => {
    return request.post<any>(API.BASE_URL, data)
}

export const updateTenantApi = (data: any): AxiosPromise<any> => {
    return request.put<any>(API.BASE_URL, data)
}

export const deleteTenantByIdApi = (id: string|number): AxiosPromise<any> => {
    return request.delete<any>(API.BASE_URL + '/' + id)
}